const { Schema, model } = require("mongoose");
//试题模块
const exercisesSchema = new Schema(
  {
    topics: String, // 题目、题干
    options: Array, // 选项 ['HTML', 'CSS', 'JS', 'Nodejs']
    answer: String, // 正确答案的下标
    analysis: String, // 解析
    score: {
      // 每一题的分数，默认每一道题 3 分
      type: String,
      default: 3
    },
    pointId: {
      // 题目所属知识点
      type: Schema.Types.ObjectId,
      ref: "pointsModel"
    }
  },
  { versionKey: false }
);
// 配置数据模型
const exercisesModel = model("exercisesModel", exercisesSchema, "exercises");
module.exports = {
  exercisesModel
};
